package com.th.supcom.pds.phamapply.client.service;

import java.util.List;

import net.carefx.framework.container.client.exception.UiException;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.th.supcom.framework.organization.web.gwt.client.model.OrganizationModel;
import com.th.supcom.pds.phamapply.client.common.InpPhamApplyServiceFactory;
import com.th.supcom.pds.phamapply.client.model.InpPhamApplyDetailModel;
import com.th.supcom.pds.phamapply.client.model.InpPhamDispenseDetailModel;
import com.th.supcom.pds.phamapply.client.model.InpPhamDispenseResultModel;

/**
 * InpPhamApplyMaster 服务接口.
 * 
 * 住院摆药请领单.
 */
@RemoteServiceRelativePath (InpPhamApplyServiceFactory.BASE_URL + "inpPhamDispenseDetail.do")
public interface InpPhamDispenseDetailRpc extends RemoteService
{

    /**
     * 查询本药房已请领未执行的护理单元
     * @return
     * @throws UiException
     */
    public List <InpPhamApplyDetailModel> getInpPhamApplyNurseUnit (String deptCode) throws UiException;
    /**
     * 查询本药房请领撤销的护理单元
     * @return
     * @throws UiException
     */
    public List <InpPhamApplyDetailModel> getInpPhamCancelNurseUnit (InpPhamApplyDetailModel model) throws UiException;

    /**
     * 获取请领明细根据请领单据号和药房
     * 
     * @param applyNo
     * @param dispensary
     * @return
     * @throws UiException
     */
    public List <InpPhamApplyDetailModel> getApplyDetailByApplyNoAndDispensary (String applyNo, String dispensary) throws UiException;
    /**
     * 请领撤销
     * @param applyNo
     * @param dispensary
     * @return
     * @throws UiException
     */
    public void cancelApplyMaster (String applyNo, String dispensary) throws UiException;

    /**
     * 执行摆药摆药明细
     * 
     * @param applyList
     * @param inpPhamApplyMaster
     * @param operator
     * @param dispensary
     */
    public void execPhamApplySheet (List <InpPhamApplyDetailModel> applyList, String operator, String dispensary) throws UiException;

    
    /**
     * 核对发药查询护理单元
     * 
     * @param dispensary
     * @return
     */
    public List <InpPhamDispenseDetailModel> findInpPhamDispenseNurse (String dispensary) throws UiException;

    /**
     * 核对发药时查询发药明细
     * 
     * @param applyNo
     * @param dispensaryNo
     * @return
     * @throws UiException
     */
    public InpPhamDispenseResultModel getInpCheckDispenseDetail (String applyNo, String dispensary, String nurseUnit) throws UiException;
    /**
     * 住院摆药查询
     * 
     * @param applyNo
     * @param dispensaryNo
     * @return
     * @throws UiException
     */
    public List <InpPhamDispenseDetailModel> getInpCheckDispenseDetail (InpPhamDispenseDetailModel inpPhamDispenseDetail) throws UiException;

    /**
     * 更新发药信息
     * 
     * @param dispenseList
     * @param operator
     * @param dispensary
     * @throws UiException
     */
    public void verifyDispenseDetail (InpPhamDispenseResultModel inpPhamDispenseResultModel, String operator, String dispensary) throws UiException;

    /**
     * 根据药品标准码查询有库存的药房
     * 
     * @param phamStdCode
     * @return
     */
    public List <OrganizationModel> findAvailableDispensary (String phamStdCode);
    
    

    /** 公司版权信息. */
    public static final String copyright = "Copyright 2014, TH Supcom Corporation";

    /** 提交路径. */
    public static final String SCC_BRANCH = "$URL$";

    /** 提交日期. */
    public static final String SCC_LAST_MODIFICATION_DATE = "$Date$";

    /** 最终修改人员. */
    public static final String SCC_LAST_MODIFIER_NAME = "$Author$";

    /** 最终版本号. */
    public static final String SCC_REVISION = "$Revision$";
}